fucked some magic code that i imported from my old version of the game -- the whole astar and heap thing...