Added a sort on final array