deterministic selection

Going to make good code of deterministic selection....