implemented the grid method