first attempt to implement general correlator fitting function