Update main.cpp

changed almost all lines
added a virtual function on the 6th line