Updated solution to exercise 2