added shutdown code, next will be more OOD
update server, client.