Adding the GUI and IO functions