added solution to hw3 problem 1