lineends corrected