offer algorithm