decided to convert from C++ -> C for this game