completed version of genetic select search