Updating quicksort and adding inference engine