getting coordinates of rows and columns