Fixed syntax, added intersections code