Homework 2 Problem 5 completed