Calculating and outputting coordinates of center of cells