cpp main update

Added completed code