Solves Problem 16
Solves Problem 25