new eqw_estimate code is split into separate functions and is much more efficient