working with class methods and inheritance