problem 7 code.