Now gets all the way to writing the final file