Updated for exercise 4