Added array sorting.