now the cost is returned as double. (fix infinite loop bug when
evaluating same cost solutions)