Replacing and reformatting websocket_server.py