Exercise 172, user-made functions, added comments