fixed read_lines and done some small changes

q