New lines better detection and matching