socket communication streamlined
cleaned up newmain