rewrote the game in C++