work in progress version - sockets