Use each_line instead of lines.