working sockets now/ fixed some bugs