     for item in @value.value
       if not set.__contains__(item)
         deletedKeys.append(item)
-    for deletedKey in deletedKeys
+    for deletedKey in deletedKeys.value
       @value.pop(deletedKey)
     return @
   
   __init__: ->
     
   __ior__: (set) ->
-    for item in set
+    for item in set.value
       @add(item)
     return @
   
   __isub__: (set) ->
-    for item in set
+    for item in set.value
       if @__contains__(item)
         @pop(item)
     return @

class Set extends Iterable
  constructor: (iterable) ->
    @value = Dictionary() # set just is a wrapped version of our own Dictionary class
    for item in iterable
      @value.__setitem__(item, true)

  __and__: (other) ->

  
  __sub__: (set) ->
    difference = @copy()
    for item in set.value
      if @__contains__(item)
        difference.pop(item)
    return difference

  __xor__: (set) ->
    xorKeys = List()
    for item in set.value
      if not @__contains__(item)
        xorKeys.append(item)
    for item in @value.value
