Made single threaded, handles multiple clients. Has bugs.