added inheritance method in M