More work towards exercise 4