Converted LM fit, MCfit into functions, included fake light curve data generator