implement solution for exercise 1