added inheritance code