         return false
     }
     
-    func serialize1(_ currentState: Int, _ start: Point, _ relative: Point, _ lastControl: Point?) -> (String, Int, Point, Point, Point?) {
+    func serialize1(_ currentState: Int, _ relative: Point, _ lastControl: Point?) -> (String, Int, Point, Point?) {
         
         switch self {
         case let .line(point):

            var currentState = currentState
            let str: String
            if _round(relative.x) == _round(point.x) {
                if currentState == 2 {
                    str = getPathDataString(nil, point.y - relative.y)
                } else {
                    str = getPathDataString("v", point.y - relative.y)
                }
                currentState = 2
            } else if _round(relative.y) == _round(point.y) {
                if currentState == 4 {
                    str = getPathDataString(nil, point.x - relative.x)
                } else {
                    str = getPathDataString("h", point.x - relative.x)
                }
                currentState = 4
            } else {
                if currentState == 6 {
                    str = getPathDataString(nil, point.x - relative.x, point.y - relative.y)
                } else {
                    str = getPathDataString("l", point.x - relative.x, point.y - relative.y)
                }
                currentState = 6
            }
            return (str, currentState, start, point, nil)
        case let .quad(p1, p2):
            
            var currentState = currentState
            let str: String
            if isSmooth(p2, relative, lastControl) && 7...10 ~= currentState {
                if currentState == 8 {
                    str = getPathDataString(nil, p2.x - relative.x, p2.y - relative.y)
                } else {
                    str = getPathDataString("t", p2.x - relative.x, p2.y - relative.y)
                }
                currentState = 8
            } else {
                if currentState == 10 {
                    str = getPathDataString(nil, p1.x - relative.x, p1.y - relative.y, p2.x - relative.x, p2.y - relative.y)
                } else {
                    str = getPathDataString("q", p1.x - relative.x, p1.y - relative.y, p2.x - relative.x, p2.y - relative.y)
                }
                currentState = 10
            }
            return (str, currentState, start, p2, p1)
        case let .cubic(p1, p2, p3):
            
            var currentState = currentState
            let str: String
            if isSmooth(p3, relative, lastControl) && 11...14 ~= currentState {
                if currentState == 12 {
                    str = getPathDataString(nil, p2.x - relative.x, p2.y - relative.y, p3.x - relative.x, p3.y - relative.y)
                } else {
                    str = getPathDataString("s", p2.x - relative.x, p2.y - relative.y, p3.x - relative.x, p3.y - relative.y)
                }
                currentState = 12
            } else {
                if currentState == 14 {
                    str = getPathDataString(nil, p1.x - relative.x, p1.y - relative.y, p2.x - relative.x, p2.y - relative.y, p3.x - relative.x, p3.y - relative.y)
                } else {
                    str = getPathDataString("c", p1.x - relative.x, p1.y - relative.y, p2.x - relative.x, p2.y - relative.y, p3.x - relative.x, p3.y - relative.y)
                }
                currentState = 14
            }
            return (str, currentState, start, p3, p2)
        }
    }
}

                } while g.next() != nil && !commandsymbol.contains(g.current.utf8.first!)
            case "T":
                repeat {
                    let p1 = lastbezier == 1 ? 2 * relative - lastcontrol : relative
                    let p2 = Point(x: try toDouble(g.current), y: try toDouble(g.next()))
                    relative = p2
                    lastcontrol = p1
