solution for exercise 3
solution for exercise 3 (reverted from commit 08163793964dc792f7bc69616de3568b716e0ab9)