added some comments, finished printing to final file