implemented func findBestSolution()