final implementation of client/server model