     
     public typealias Generator = IndexingGenerator<SDPath>
     
-    private var segment: [SDPathCommand]
+    private var commands: [SDPathCommand]
     
     public var transform : SDTransform
     
     public init() {
-        segment = []
-        transform = SDTransform(SDTransform.Identity())
+        self.commands = []
+        self.transform = SDTransform(SDTransform.Identity())
     }
     
     public init(arrayLiteral elements: SDPathCommand ...) {
-        segment = elements
-        transform = SDTransform(SDTransform.Identity())
-    }
-    
-    public init<S : SequenceType where S.Generator.Element == SDPathCommand>(_ segments: S) {
-        segment = segments.array
-        transform = SDTransform(SDTransform.Identity())
+        self.commands = elements
+        self.transform = SDTransform(SDTransform.Identity())
+    }
+    
+    public init<S : SequenceType where S.Generator.Element == SDPathCommand>(_ commands: S) {
+        self.commands = commands.array
+        self.transform = SDTransform(SDTransform.Identity())
     }
     
     public var center : Point {

extension SDPath : RangeReplaceableCollectionType {
    
    public mutating func append(x: SDPathCommand) {
        segment.append(x)
    }
    
    public mutating func appendContentsOf<S : SequenceType where S.Generator.Element == SDPathCommand>(newElements: S) {
        segment.appendContentsOf(newElements)
    }
    
    public mutating func removeLast() -> SDPathCommand {
        return segment.removeLast()
    }
    
    public mutating func popLast() -> SDPathCommand? {
        return segment.popLast()
    }
    
    public mutating func reserveCapacity(minimumCapacity: Int) {
        segment.reserveCapacity(minimumCapacity)
    }
    
    public mutating func removeAll(keepCapacity keepCapacity: Bool = false) {
        segment.removeAll(keepCapacity: keepCapacity)
    }
    
    public mutating func replaceRange<C : CollectionType where C.Generator.Element == SDPathCommand>(subRange: Range<Int>, with newElements: C) {
        segment.replaceRange(subRange, with: newElements)
    }
    
    public mutating func insert(newElement: SDPathCommand, atIndex i: Int) {
        segment.insert(newElement, atIndex: i)
    }
    
    public mutating func insertContentsOf<S : CollectionType where S.Generator.Element == SDPathCommand>(newElements: S, at i: Int) {
        segment.insertContentsOf(newElements, at: i)
    }
    
    public mutating func removeAtIndex(i: Int) -> SDPathCommand {
        return segment.removeAtIndex(i)
    }
    
    public mutating func removeRange(subRange: Range<Int>) {
        segment.removeRange(subRange)
    }
}


    
    public init(_ rect: Rect) {
        let points = rect.points
        commands = [Move(points[0]), Line(points[1]), Line(points[2]), Line(points[3]), ClosePath()]
        transform = SDTransform(SDTransform.Identity())
    }
    
    public init(_ rect: SDRectangle) {
        let points = rect.points
        commands = [Move(points[0]), Line(points[1]), Line(points[2]), Line(points[3]), ClosePath()]
        transform = SDTransform(SDTransform.Identity())
    }
    
