code cleanup, finished exercise 5