completed up to problem 9