in reply to Re^2: why doesn't this sort work?
in thread why doesn't this sort work?

does a foreach loop guarantee to go through elements in order?

Absolutely