second attempt at exercise 2