first version of exercise 7