def METHOD_NAME(p0, fit_func, *x):
    '''
    residual for fnctions y= f(u,v,w,...)
    x = variable length tuple with one dependent variable at the end
    x=(u,w,v,y)
    u,v,w,y all have the same length
    '''
    p0=tuple(p0)
    print(p0)
    qt.msleep()
    return x[-1]-fit_func(*(x[:-1]+p0))