Solves problem 14