completing previous commit; as well as the implementation of a function to ensure the existence of a clear path from the hero to the goal