problem 6, finished