public String[] sortByOdds(String[] rules) {

        if(rules.length!=0){
        for(String test:rules){

            String temp[]=test.split(":");
            str = new StringTokenizer(temp[1]);
            ArrayList<String> values = new ArrayList<String>();
            while(str.hasMoreTokens()){
                values.add(str.nextToken());
            }

            double probability= calculateScore(values);
            ruleSet.put(probability,temp[0]);
            probabilitiesOfRules.add(probability);

        }

            sort(probabilitiesOfRules);
            resultingLotteryRules = new String[probabilitiesOfRules.size()];
            m=0;
            listLength = resultingLotteryRules.length;
            for(Double temp:probabilitiesOfRules) {
                if(m<listLength){

                     resultingLotteryRules[m]=ruleSet.get(temp).toString();
                    System.out.println("String is :"+resultingLotteryRules[m]+"  Temp is :"+temp);
                }
                m++;
            }

            return resultingLotteryRules;
        }
        else

		return new String[] { };
	}