added surrogate elimination to queries