Grid: more efficient comparisons, fewer type conversions