finished client code ish