added argument for output dir