Rewrote some stuff and added socket.io