added game over and heuristic