Cleaned up code
Completed websocket implementation