merged some A* functionality