assignment 3 - problem 5 completed