add copy modified functionality
fix output directory creation