add option for running on multiple directories, and setting output file automatically