fixing bugin griding.py