Changed ProbabilityCostComparator code, added test case too.