first attempt at exercise 2