add quick sort with pattern matching