week 1, mostly done except error on server close