updates remaining_elts fn