Added an option to input the directory. A more sophisticated method would be nice as well as being able to select certain files to exclude but I think it is good enough for now and suits my needs.