solved problem 8 on to problem 9