Slight modification to exercise 3 to conform with the assignment.