alternative implementation for Lesson 10