add fit function on a list of x,y