Changed line intersection code