Cleaned set_of_lines generation code