Use basename instead of full path of input files to make output directory name