Changed QuickSort to stack-based version