def nm_shrink(verts, indexes, sigma):
    """Shrinks the simplex according to the definition of the nelder-mead method.
    Args:
        verts:      Array of verticies
        indexes:    Arrays if intergers ordering verts according to assiciated function values
        sigma:      a parameter important to compute the shrinked simplex

    Returns:
        out:       new simplex

    """
    # set best vert
    v_0 = verts[indexes[0]]
    # compute other verts
    for i in indexes[1:]:
        verts[i] = v_0 + sigma * (verts[i] - v_0)
    return verts