class inheritance working