Program for fitting custom functions