program answer for exercize 10: writing a server