adding support for isolated edges in the input