intersection detection added for simple cases