Finished exercise 2 with tests.