adjusted structure and added file_output function