completed Homework 3 Problem 3