Completed assignment 2 problem 2