Writing a basic quicksort implementation