added sortArray()