Working on C++ inheritance