faster grid indices