made some functions for game.cpp