put on_domain_boundary into code as a switch rather than sele.ne.0