Problem 11
Implemented problem 12