Basic Chat Server. Errorchecking, code tidy required