use Array::sort to avoid relying on for-in enumeration order