                 curpt = points[3]
             
             case kCGPathElementCloseSubpath.value:
-                block(type:kCGPathElementCloseSubpath, points:[curpt, self.getPoint(0)!])
+                block(type:kCGPathElementCloseSubpath, points:[curpt, start])
             default:
                 println("default")
             }

        var pt:CGPoint?
        var i = 0
        
        CGPathApplyWithBlock(self) {
            (elementPtr:UnsafePointer<CGPathElement>) -> Void in
            if index == i++ {
                let element : CGPathElement = elementPtr.memory
                pt = element.points.memory
            }
        }
        return pt


public extension CGPath {
    func enumerate(block:(type:CGPathElementType, points:[CGPoint]) -> Void) {
        var curpt = CGPoint()
        var start = curpt
        
        CGPathApplyWithBlock(self) {
            (elementPtr:UnsafePointer<CGPathElement>) -> Void in
