Implements a faster version of built in quicksort algoritm