fixed where if left is smaller than right for quick sort