method returns the row and cols