added open socket function, and minor changes to UI