incomplete: issues with open_file function