Lesson 4: final version of task 8 and 9