init with server/client code.

Code provided by TA. This is a starting point.