Adding the change_file function