defined main function, that takes a game and config as parameters