allow graphs to be undirected, end search when goal is found and modify shortest path logic.