added custom output directory as argument