completed the intersection code for curves. not debugged though