new line intersection algorithm