fix line intersection formula