added solution for hw1 problem 9