Exercise done in class with classes