added an implementation of class inheritance