Task cancellation implemented for sort routines

except quicksort - needs a work around