some intersection code