some work on the selection algorithms