Implemented grids, fixed pixel straddling bug