created server class copied over and modified some of multithread code.