update exercise 10 with class methods