UP: changed modify_file around a little