selection algorithm
starting sample 64