 
   # http://docs.python.org/library/stdtypes.html#set.discard
   discard: (elem) ->
-    if @value.__contains__(elem)
+    if @__contains__(elem).value
       @value.pop(elem)
     return
 


  # http://docs.python.org/library/stdtypes.html#set.pop
  pop: ->
    if @value.__len__ == 0
      (new KeyError "pop from an empty set").raise()
    else
      randomItem = @value.popitem() # dict.popitem() pops a random item
      randomKey = randomItem.__getitem__(0)

  
  # http://docs.python.org/library/stdtypes.html#set.add
  add: (element) ->
    @value.__setitem__(element, new Bool(true))
    return
    
  # http://docs.python.org/library/stdtypes.html#set.clear
