changed some bugs, changed back to unordered_set