     
     public subscript(index: Index) -> Element {
         get {
-            if let element = elementAtIndex(index) {
-                return element
-            } else {
-                fatalError("Index out of bounds in OrderedDictionary.")
+            guard let element = elementAtIndex(index) else {
+                fatalError("OrderedDictionary index out of range")
             }
+            
+            return element
         }
         set(newValue) {
             updateElement(newValue, atIndex: index)

    
    public mutating func removeValueForKey(key: Key) -> Value? {
        if let index = orderedKeys.indexOf(key) {
            orderedKeys.removeAtIndex(index)
            guard let currentValue = keysToValues[key] else { fatalError("Inconsistency error occured in OrderedDictionary.") }
            keysToValues[key] = nil
            return currentValue
        } else {
            return nil

    
    public mutating func updateValue(value: Value, forKey key: Key) -> Value? {
        if orderedKeys.contains(key) {
            guard let currentValue = keysToValues[key] else {
                fatalError("Inconsistency error occured in OrderedDictionary")
            }
            
            keysToValues[key] = value
            return currentValue
        } else {
