Polymorphisim with C++. Was from a class