Added output directory and trap for cleanup