 //            }
             self.puzzle.calcuateTheShortestWay({ (result) in
                 DispatchQueue.main.async {
-                    let stringResult = result.map({ (value) -> String in
+                    let stringResult: String = result.reduce("", { (result, value) -> String in
                         switch value {
                         case -4:
-                            return "D"
+                            return result + "U"
                         case 4:
-                            return "U"
+                            return result + "D"
                         case -1:
-                            return "L"
+                            return result + "L"
                         case 1:
-                            return "R"
+                            return result + "R"
                         default:
                             return ""
                         }
                     })
                     
                     NotificationCenter.default.post(name: NSNotification.Name(rawValue: "com.hanguang.app.puzzle.PuzzleFinishedNotification"),
-                                                    object: nil, userInfo: ["resutls": stringResult])
+                                                    object: nil, userInfo: ["resutls": [stringResult as NSString]])
                 }
             })
         }

        return columnCount * rowCount
    }
    
    func calcuateTheShortestWay(_ completion: ([Int8]) -> Void) {
        DispatchQueue.global(qos: .userInitiated).async {
            var result: [Int8] = []
            var calcuatedFramesCount: UInt = 0
            var snapshots: [PuzzleFrame: Int] = [:]
            
            let puzzleFrame = PuzzleFrame(previousStep: 0, currentStep: 0, frame: self.beginFrame, steps: [])
            var currentFramesQueue: [PuzzleFrame] = [puzzleFrame]
            var nextFramesQueue: [PuzzleFrame] = []
            snapshots[puzzleFrame] = puzzleFrame.steps.count
            calcuatedFramesCount += 1
            
            var found = false

                if !result.isEmpty {
                    print("Result: \(result), total frame calcuated: \(calcuatedFramesCount)")
                    found = true
                    completion(result)
                }
                
                currentFramesQueue = nextFramesQueue
