rewrote the game in c++