Simplifying the grid function, and cleaning up typos.