Tidied code structure for Chapter 1.
Completed Chapter 2 exercises.
Refactored code and organized imports.