solution for homework2