first version of exercise 8