fixed printf statements to be clearer and prints out most of file