item selection algorithm