Updated estimator code with header comments