moved the heuristic function from Comparator class to State class