Added input parameter validation. Made some modifications to the GUI.