fixed astar weighting issues and some other bugs
merged changes