added inheritance logic