Edits to get_lines. Code untested