Added in some unit tests and fixed getEstimate