implemented quadratic estimator, and some plotting functionality