Write output to output directory