Added heuristic to ida