full loop running in test scenarion, next hook up to pds and fsm, need to deal with sigular matrices in polyfit