Implemented line intersection algo