let to_line (x:string) : line = let l = (String.length x) in let last = (String.sub x (l-1) 1) in match last with "\n" -> x | _ -> x^"\n"