new logic for server
add client code