Update grid.py

upgrade complete