fixed math error in estimator, added debug messages