Algorithm now finds median line.