Added option to change output directory.