changed read_last_line, changed two lines in place