fixed the intersects part of the algorithm. only lightly tested atm.