 //  limitations under the License.
 //
 
-struct OrderedSet<Element: Hashable> {
+struct OrderedSet<Element: Hashable>: RandomAccessCollection, Hashable {
     
-    typealias Index = Int
+    typealias Index = Array<Element>.Index
     
     private var elements: [Element] = []
     

    }
    
    
    /// return the element at the specified position.
    subscript(_ index: Index) -> Element {
        

    /// remove the elements of the set that aren’t also in the given sequence.
    mutating func formIntersection<S: Sequence>(_ other: S) where S.Element == Element {
        
        self.elements.removeAll { !other.contains($0) }
    }
    
    
