Solved through problem 6