reverts yvarov's astar rewrite from 16/5

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
Merge pull request #828 from caelaislinn/astar_reversion

Reverts yvarov's astar rewrite from 16/5