added inheritance to the subclasses