Updated for exercise 3