exercise 6. task 1: corrected version