implemented set() and tests for it