Solved problem 14
Solved problem 15
Refactored to use mapcat
Solved problem 16
Solved problem 17