Solves Problem 8
Solves Problem 14