inheritance working perfectly