set index for row and column