Intersections algorithm implementation complete (I hope... T_T)