before cahnging if logic
before astar