solution to problem one of the second homework assignment