correct solution for simple intersection