solution to homework2