Clean up old function
Solve problem 15
Solve problem 16