worked on front-end only, ready for socket.io