first version of exercise 3