updated through exercise 3