     }
 
     private func findTile(tile: Character) -> (dividedArrayPos: Int, modulusArrayPos: Int) {
-        //let index = boardLayout.characters.indexOf(tile)
-        
-        let fromStart = boardLayout.startIndex
-        let index = fromStart.advancedBy(boardLayout.characters.count)
+        var index = 0
+        for i in boardLayout.characters.indices {
+            if boardLayout[i] == tile {
+                break
+            }
+            index += 1
+        }
 
         return (index / BoardNode.squareGridSize, index % BoardNode.squareGridSize)
     }

        self.boardLayout = boardLayout
        self.direction = direction
        self.g = prevBoard != nil ? prevBoard!.data.g + 1 : g
        self.h = hValue()
        self.f = self.g + self.h
        self.blankTilePos = findTile(BoardNode.blankTile)
    }

    private mutating func pushPossibleMove(node: Node<BoardNode>) {

    }

    private func placed() -> Int {
        var misplaced = false
        var placed = 0
        var index = 0

        if boardLayout.characters.count == BoardNode.goal.characters.count {
            while misplaced == false && index < BoardNode.squareGridSize * BoardNode.squareGridSize {
                for i in boardLayout.characters.indices {
                    if boardLayout[i] != BoardNode.goal[BoardNode.goal.startIndex.advancedBy(index)] {
                        misplaced = true
                    } else {
                        placed += 1
                    }
                    index += 1
                }
            }
        }

        return placed
    }

    private func misplaced() -> Int {
        return 9 - placed()
    }

    private func hValue() -> Int {
