problem 6 done, problem 5 is a mess