A* optimizations