Make the output files and fixed the fact that it wasn't working