More work on A* implementation