 }
 
 public struct SimplicialComplex {
-    public let simplices: Set<Simplex>
+    public let simplices: OrderedSet<Simplex>
     
     public init<S: Sequence>(_ simplices: S, generate: Bool = false) where S.Iterator.Element == Simplex {
         self.simplices = generate ?
-            simplices.reduce(Set()) { $0.union($1.allSubsimplices()) }
-            : Set(simplices)
+            simplices.reduce(OrderedSet()) { $0 + $1.allSubsimplices() }
+            : OrderedSet(simplices)
     }
     
     public func chainComplex<R: Ring>() -> ChainComplex<Simplex, R> {

    }
    
    public func allSubsimplices() -> [Simplex] {
        var queue = OrderedSet(sequence: [self])
        var i = 0
        while(i < queue.count) {
            let s = queue[i]

        return Homology(chainComplex())
    }
}

fileprivate extension OrderedSet {
    convenience init<S: Sequence>(_ s: S) where S.Iterator.Element == T {
        self.init(sequence: s)
    }
}
