optimized GridMatrix in game_grid.py