changed functions to use frozenset same functions
added tests for set functions