WORKING REVISION:

refractored server to work as chat server.