     }
 
     indexByElement[element] = nil
-    contents.removeAtIndex(index)
+    elements.removeAtIndex(index)
 
     return true
   }

    return indexByElement[element] != nil
  }
}


import Foundation

struct OrderedSet<T: Hashable>: ArrayLiteralConvertible {
  private var indexByElement: [T: Int] = [:]
  private var elements: Array<T> = []

  var count: Int {
    return elements.count
  }

  init(arrayLiteral elements: T...) {
    for element in elements {
      append(element)
    }
  }

  mutating func append(element: T) {
