add sorting algorithm into section 3