Start work on the selector
improve algorithm