diff --git a/Board.py b/Board.py
index 68574d3627ea11019570d0fca5e3b56d5b9aa22b..15f7968000d2f692e7b3317b0ab63fb8352aaef8 100644
--- a/Board.py
+++ b/Board.py
@@ -1,46 +1,60 @@
 import Tile
 class Board:
+    exit_tiles = [(3,-3), (3,-2), (3,-1), (3,0)]
+    """
     directions = ['l', 'tl', 'tr', 'r', 'br', 'bl']
     moves = {'l':(-1,0), 'tl':(0,-1), 'tr':(1,-1), 'r':(1,0),
             'br':(0,1), 'bl':(-1,1)}
-    tiles = [[None for i in range(7)] for j in range(7)]
+            """
+    moves = [(-1,0), (0,-1), (1,-1), (1,0), (0,1), (-1,1)]
     def __init__(self):
-        r = -3
-        for q in range(0, 4):
-            self.new_tile(q,r)
-        r = -2
-        for q in range(-1, 4):
-            self.new_tile(q,r)
-        r = -1
-        for q in range(-2, 4):
-            self.new_tile(q,r)
-        r = 0
-        for q in range(-3, 4):
-            self.new_tile(q,r)
-        r = 1
-        for q in range(-3, 3):
-            self.new_tile(q,r)
-        r = 2
-        for q in range(-3, 2):
-            self.new_tile(q,r)
-        r = 3
-        for q in range(-3, 1):
-            self.new_tile(q,r)
+        self.tiles = [[None for i in range(7)] for j in range(7)]
+        self.tiles[0][0] = 0
+        self.tiles[0][1] = 0
+        self.tiles[0][2] = 0
+        self.tiles[1][0] = 0
+        self.tiles[1][1] = 0
+        self.tiles[2][0] = 0
+        self.tiles[4][6] = 0
+        self.tiles[5][5] = 0
+        self.tiles[5][6] = 0
+        self.tiles[6][4] = 0
+        self.tiles[6][5] = 0
+        self.tiles[6][6] = 0
+        self.pieces = []
+        self.g = 0
+        self.f = 0
+        self.parent = None
+    
+    def getMoves(self):
+        valid_moves = []
+        for piece in self.pieces:
+            if piece.pos in self.exit_tiles:
+                return piece
+            p_r = piece.pos[1]+3
+            p_q = piece.pos[0]+3
+            for move in self.moves:
+                if p_r + move[1] > 6 or p_r + move[1] < 0 or p_q + move[0] > 6 or p_q + move[0] < 0:
+                    continue
 
-    def new_tile(self, q, r):
-        tile = Tile.Tile((q,r))
-        self.tiles[r+3][q+3] = tile
+                if self.tiles[p_r + move[1]][p_q + move[0]] is None:
+                    valid_moves.append(((p_q-3, p_r-3),(p_q-3 + move[0], p_r-3 + move[1])))
+
+                elif p_r + move[1]*2 <= 6 and p_r + move[1]*2 >= 0 and p_q + move[0]*2 <= 6 and p_q + move[0]*2 >= 0:
+                    if self.tiles[p_r + move[1]*2][p_q + move[0]*2] is None:
+                        valid_moves.append(((p_q-3, p_r-3),(p_q-3 + move[0]*2, p_r-3 + move[1]*2)))
+        
+        return valid_moves
 
     def move(self, t_from, t_to):
-        tile_from = self.tiles[t_from[1]+3][t_from[0]+3]
-        tile_to = self.tiles[t_to[1]+3][t_to[0]+3]
-        tile_from.piece.pos = t_to
-        tile_to.piece = tile_from.piece
-        tile_from.piece = None
+        piece = self.tiles[t_from[1]+3][t_from[0]+3]
+        self.tiles[t_from[1]+3][t_from[0]+3] = None
+        self.tiles[t_to[1]+3][t_to[0]+3] = piece
+        self.tiles[t_to[1]+3][t_to[0]+3].pos = t_to
 
     def distance(self, start, end):
-        q1 = start.pos[0]
-        q2 = end.pos[0]
-        r1 = start.pos[1]
-        r2 = end.pos[1]
+        q1 = start[0]
+        q2 = end[0]
+        r1 = start[1]
+        r2 = end[1]
         return (abs(q1 - q2) + abs(q1 + r1 - q2 - r2) + abs(r1 - r2))/2
diff --git a/Piece.py b/Piece.py
index 3ef64051d956220834b9041a2221624556a429d6..9331642655506a59f5c8637566fd99748575f3d9 100644
--- a/Piece.py
+++ b/Piece.py
@@ -1,4 +1,4 @@
 class Piece:
-    def __init__(self, pos):
+    def __init__(self, pos, colour):
         self.pos = pos
-        self.visited = [self.pos]
+        self.colour = colour
diff --git a/__pycache__/Board.cpython-36.pyc b/__pycache__/Board.cpython-36.pyc
index a0bf57e25c327c443cf9549e5232aef0d9d72a62..f9e8f3375bc235d21baf8a21e37f29b5d1235765 100644
Binary files a/__pycache__/Board.cpython-36.pyc and b/__pycache__/Board.cpython-36.pyc differ
diff --git a/__pycache__/Piece.cpython-36.pyc b/__pycache__/Piece.cpython-36.pyc
index bc198be1829e1b465f4c87e94de2a60d62b0fa56..8b7c34fc71bb2295e61485daec010de8badf2e74 100644
Binary files a/__pycache__/Piece.cpython-36.pyc and b/__pycache__/Piece.cpython-36.pyc differ
diff --git a/game.py b/game.py
index 918385e652fc448b53246fd2714ace1aeb535636..a958bdc1df8f2c0d4d443010c2069dacb424712e 100644
--- a/game.py
+++ b/game.py
@@ -1,46 +1,152 @@
 import sys
 import json
+import copy
 import Board
 import Piece
 import Block
 
 board = Board.Board()
+exit_tiles = {'red':[(3,-3),(3,-2),(3,-1),(3,0)]}
 
 def main():
     with open(sys.argv[1]) as file:
         data = json.load(file)
         bdict = {}
         for p in data['pieces']:
-            piece = Piece.Piece(tuple(p))
-            for row in board.tiles:
-                for tile in row:
-                    if tile is not None and tile.pos == piece.pos:
-                        tile.add_piece(piece)
-
+            piece = Piece.Piece(tuple(p), data['colour'])
+            board.tiles[piece.pos[1]+3][piece.pos[0]+3] = piece
+            board.pieces.append(piece)
+        
         for b in data['blocks']:
             block = Block.Block(tuple(b))
-            for row in board.tiles:
-                for tile in row:
-                    if tile is not None and tile.pos == block.pos:
-                        tile.add_block(block)
-
-        bdict = make_bdict()
-        print_board(bdict)
-        board.move((0,0),(0,1))
-        bdict = make_bdict()
-        print_board(bdict)
-        print(board.distance(board.tiles[3][3], board.tiles[2][6]))
-
-def make_bdict():
+            board.tiles[block.pos[1]+3][block.pos[0]+3] = block
+        
+        path = A_Star(board)
+        if path is None:
+            print("No path found")
+        else:
+            for node in path:
+                bdict = make_bdict(node)
+                print_board(bdict)
+
+
+def A_Star(start):
+    closedSet = []
+    openSet = [start]
+
+    start.g = 0
+
+    start.f = heuristic(start)
+    while openSet:
+        minF = 1000000
+        for node in openSet:
+            if node.f <= minF:
+                current = node
+                minF = current.f 
+
+        if checkGoal(current):
+            return retrace(current) 
+
+        openSet.remove(current)
+        closedSet.append(current)
+
+        neighbors = getNeighbors(current)
+
+        for neighbor in neighbors: 
+            """
+            inClosed = False
+            for node in closedSet:
+                if listCompare(neighbor.tiles, node.tiles):
+                    inClosed = True
+            if inClosed:
+                continue
+            """
+
+                #if neighbor.tiles == node.tiles:
+                 #   continue
+            tentative_gScore = current.g + 1
+            
+            inOpen = False
+            for node in openSet:
+                if listCompare(neighbor.tiles, node.tiles):
+                    inOpen = True
+
+            if not inOpen:
+                openSet.append(neighbor)
+                
+            elif tentative_gScore >= neighbor.g:
+                continue
+
+            neighbor.parent = current
+            neighbor.g = tentative_gScore
+            neighbor.f = neighbor.g + heuristic(neighbor)
+
+def listCompare(list1, list2):
+    for i in range(0,7):
+        for j in range(0,7):
+            if type(list1[i][j]) is not type(list2[i][j]):
+                return False
+
+    return True
+
+def heuristic(node):
+    h = 0
+    for piece in node.pieces:
+        min_dist = 10
+        for tile in exit_tiles['red']:
+            if board.distance(piece.pos, tile) <= min_dist:
+                min_dist = board.distance(piece.pos, tile)
+        h += (min_dist + 1) / 2
+    return h
+
+def checkGoal(state):
+    if not state.pieces:
+        return True
+    else:
+        return False
+
+def retrace(goal):
+    path = []
+    cur = goal
+    while cur.parent is not None:
+        path.insert(0,cur)
+        cur = cur.parent
+    path.insert(0,cur)
+    return path
+
+def getNeighbors(current):
+    neighbors = []
+    moves = current.getMoves()
+    
+    if isinstance(moves, Piece.Piece):
+        neighbor = copy.deepcopy(current)
+        
+        for piece in neighbor.pieces:
+            if piece.pos == moves.pos:
+                neighbor.pieces.remove(piece)
+                break
+
+        neighbor.tiles[moves.pos[1]+3][moves.pos[0]+3] = None
+        
+        neighbors.append(neighbor)
+        return neighbors
+
+    for move in moves:
+        neighbor = copy.deepcopy(current)
+        neighbor.move(move[0], move[1])
+        neighbors.append(neighbor)
+    return neighbors
+
+def make_bdict(state):
 
     bdict = {}
 
-    for row in board.tiles:
-        for tile in row:
-            if tile is not None and tile.piece is not None:
-                bdict[tile.piece.pos] = 'p'
-            elif tile is not None and tile.block is not None:
-                bdict[tile.block.pos] = 'b'
+    for row in state.tiles:
+        for col in row:
+            if isinstance(col, Piece.Piece):
+                bdict[col.pos] = 'p'
+            elif isinstance(col, Block.Block):
+                bdict[col.pos] = 'b'
 
     return bdict
 
diff --git a/input2.json b/input2.json
new file mode 100644
index 0000000000000000000000000000000000000000..e27ab876c800011cebeb66f87c8cda4c44f9ac42
--- /dev/null
+++ b/input2.json
@@ -0,0 +1,5 @@
+
+	"colour": "red",
+	"pieces": [[1,1]],
+	"blocks": []
+}
diff --git a/input3.json b/input3.json
new file mode 100644
index 0000000000000000000000000000000000000000..acb07c4e08052952cf2c5af601bf82b907883d01
--- /dev/null
+++ b/input3.json
@@ -0,0 +1,5 @@
+{
+	"colour": "red",
+	"pieces": [[0,0],[0,-1]],
+	"blocks": [[-1,0],[-1,1],[1,1],[3,-1]]
+}
diff --git a/input4.json b/input4.json
new file mode 100644
index 0000000000000000000000000000000000000000..d6986fa15a7b2f4df28c3b440ebfc3282ec5aac2
--- /dev/null
+++ b/input4.json
@@ -0,0 +1,5 @@
+{
+	"colour": "red",
+	"pieces": [[0,0],[0,-1],[-2,1],[-3,0]],
+	"blocks": [[-1,0],[-1,1],[1,1],[3,-1]]
+}
diff --git a/input5.json b/input5.json
new file mode 100644
index 0000000000000000000000000000000000000000..15ed7be72c45a9fce8228207e2786898cc50a6d4
--- /dev/null
+++ b/input5.json
@@ -0,0 +1,7 @@
+{
+	"colour": "red",
+	"pieces": [[0,-3],[1,-3],[2,-3],[-3,0]],
+	"blocks": [[3,-3],[3,-2],[3,-1],[2,-1],[2,0],[1,0],[1,1],[0,1],[0,2],[-1,2]]
+}
+
+
diff --git a/out.txt b/out.txt
new file mode 100644
index 0000000000000000000000000000000000000000..515c6b4b46fc8f273674d63c3bede11f564cebdf
--- /dev/null
+++ b/out.txt
@@ -0,0 +1,80 @@
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |     | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |     |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |     |     |  p  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |     | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |     |     |     |  p  |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |     |     |     |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  p  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |     |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |     |     |     |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |     | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |     |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |     |     |     |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |     | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |     |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |     |     |     |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
diff --git a/out1.txt b/out1.txt
new file mode 100644
index 0000000000000000000000000000000000000000..cc70f06064cd38d5bc9c8cfe16b1dfafad3dcf15
--- /dev/null
+++ b/out1.txt
@@ -0,0 +1,176 @@
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |  p  |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |  p  |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |  p  |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |  p  |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |  p  |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |  p  |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |  p  |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |  p  |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |  p  | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |  p  |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |  p  |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |  p  | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |  p  |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |  p  |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |  p  | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |  p  | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |  p  |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |  p  | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |  p  |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |  p  | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |  p  |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |  p  | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |  p  |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |  p  | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
diff --git a/out2.txt b/out2.txt
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/out5.txt b/out5.txt
new file mode 100644
index 0000000000000000000000000000000000000000..009d5a77e1438881936904c658a873c6e8b606af
--- /dev/null
+++ b/out5.txt
@@ -0,0 +1,112 @@
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |  p  |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |  p  |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |  p  |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |  p  |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |  p  |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |  p  |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |  p  | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |  p  |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |  p  |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |  p  | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
diff --git a/out6.txt b/out6.txt
new file mode 100644
index 0000000000000000000000000000000000000000..cc70f06064cd38d5bc9c8cfe16b1dfafad3dcf15
--- /dev/null
+++ b/out6.txt
@@ -0,0 +1,176 @@
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |  p  |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |  p  |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |  p  |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |  p  |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |  p  |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |  p  |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |  p  |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |  p  |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |  p  | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |  p  |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |  p  |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |  p  | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |  p  |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |  p  |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |  p  | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |  p  | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |  p  |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |  p  | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |  p  |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |  p  | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |  p  |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |  p  | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |  p  |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |  p  | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'
+# 
+#           .-'-._.-'-._.-'-._.-'-.
+#          |     |     |     |     | 
+#        .-'-._.-'-._.-'-._.-'-._.-'-.
+#       |     |     |     |     |     | 
+#     .-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+#    |     |     |     |     |     |  b  | 
+#  .-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-.
+# |     |     |  b  |     |     |     |     | 
+# '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#    |     |     |  b  |     |  b  |     | 
+#    '-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'
+#       |     |     |     |     |     | 
+#       '-._.-'-._.-'-._.-'-._.-'-._.-'
+#          |     |     |     |     |
+#          '-._.-'-._.-'-._.-'-._.-'