def _partition(array, low, high):
    """
        Sort values lower < pivot index < higher.

        Args:
            array (list): unsorted list with pivot in [0]
            low (int): lowest index
            high (int): highest index

        Returns (int): index of sorted value
    """
    pivot = array[low]
    i = low + 1
    for j in range(low + 1, high):
        if array[j] < pivot:
            array[i], array[j] = array[j], array[i]
            i += 1
    array[low], array[i - 1] = array[i - 1], array[low]

    return i - 1