Modify toLineHit logic formulation