working client - all tests pass (hopefully)