removed unused code
implemented first version of intersect