   }
 
   @warn_unused_result
-  public func advance(i: Index, by n: Index.Distance) -> Index {
+  public func advance(i: Index, by n: IndexDistance) -> Index {
     if n >= 0 {
       return _advanceForward(i, by: n)
     }
     var i = i
-    for var offset: Index.Distance = n; offset != 0; offset = offset + 1 {
+    for var offset: IndexDistance = n; offset != 0; offset = offset + 1 {
       _previousInPlace(&i)
     }
     return i
   }
 
   @warn_unused_result
-  public func advance(i: Index, by n: Index.Distance, limit: Index) -> Index {
+  public func advance(i: Index, by n: IndexDistance, limit: Index) -> Index {
     if n >= 0 {
       return _advanceForward(i, by: n, limit: limit)
     }
     var i = i
-    for var offset: Index.Distance = n; offset != 0 && i != limit;
+    for var offset: IndexDistance = n; offset != 0 && i != limit;
         offset = offset + 1 {
       _previousInPlace(&i)
     }

    return startIndex == endIndex
  }

  public var count: Index.Distance {
    return distanceFrom(startIndex, to: endIndex)
  }


  }
}
extension MyBidirectionalCollectionType
  where
  Index : MyRandomAccessIndex,
  Index.Distance == IndexDistance {

  @warn_unused_result
  public func previous(i: Index) -> Index {
