solved first exercise of OOP7-LT