js renumber function