game tree made and functional