beginning to sort out server and client from old code