Partial solution to 13b
Improved 13b
Finished 13b