hashset implementation with added minor changes from before