code using algo to check intersection of two lines