@chrispsn there isn't much difference. with your method it's easier to spot if the big array is reffed and unreffed properly so all amendments are in-place. mine is just easier to code and a bit shorter. i think the improvement comes mostly from the other tricks i applied - particularly the simpler "while" condition