working socket integration and user functions