Updated: use map to get row and column values