Move code around
Fixup previous commit

Was not decreasing num_items.  Ouch!