How do I make this work with lines of any length

Printable View