Refactoring calcDataForHeuristic()

It's significantly easier to read now
Ooops, giant bug, pos->neg in checking heuristic limit