Implemented problem 14