defined x_y method (returns columns and rows values for a given 2d array)