Answer for the exercise in class