BROKEN CODE. Fixes bugs relating to grid.allTiles vs grid.originalTiles.