added iterative selection algorithm