Solved problem 12! finally