added inheritance and polymorphism, modified tests so they are compatible