modified heuristics bit....

Ending heuristics added