Started adding socket logic