fix offers algorithm