Tested and corrected get_edge_span