partial implementation for Level 2 -> OOP -> Problem 8