I believe there are better ways than use astar, but I have to check on that