add logic for finding ndoe edge