implement Set, add tests, debug