add option to cap lines at top and bottom