added argument to pass input directory