corrected calculation for positions in partial selections of the grid