Shifted implementation of updateRowNumbers