 
     private(set) var tortoises: [Tortoise] = []
     private(set) var commandHistories: [(tortoiseTag: Int, commandIndex: Int)] = []
-
-    // ⭐️ Add lock object.
-    private let lock = NSLock()
 
     var commandedHandler: ((TortoiseCharmer) -> Void)?
 

            states[index].canvasSize = context.size
        }

        for (index, history) in commandHistories.enumerated() where index <= toIndex {
            states[history.tortoiseTag] =
                tortoises[history.tortoiseTag]
                    .commands[history.commandIndex]
                    .exexute(in: states[history.tortoiseTag], with: context.cgContext)
        }

        for index in 0..<tortoises.count {

            let tortoise = Tortoise()
            tortoise.tag = index
            tortoise.commandedHandler = { [unowned self] (tortoise) in
                self.commandHistories.append((tortoiseTag: tortoise.tag,
                                              commandIndex: tortoise.commands.count - 1))
                self.commandedHandler?(self)
