Fixed n==2, it should adapt to number of parameters