Adds code for exercise 5