Changed functionality of edge_distance, finished visible_vertices algorithm