Added code so we can use sockets