working on ch. 4. server part