Slightly refactor and document the code.
Finalizing the exercises.