HW1 Problem 2

work on second problem of first homework assignment