updated print formatting for problem 16