added sorting method for overallBest algorithm