EDIT: Edited quick sort.