Merged code from Gui_for_Data to Data Logging