Fixed intersects function