adding socket code to the mix