initial setup with sockets etc