fixed all set and sorted set functions and test functions