Implemented quick sort.