finished up until problem 9