added code to check a whole bunch of segment crossing, defined on separete points array.