cc rewritten using socket.io