Looks like this might stall if you let it run long enough. The problem is in the compare template used for sorting. You can change it to the following code, this should work. (Fingers crossed). Will update the zip tomorrow. //CODE BEGIN template <class T> class NNCompare { public: bool operator()(T p, T q) { return (double)p.fitness > (double)q.fitness; } }; //CODE END Best, RDL