diff --git a/src/game/penguin.cpp b/src/game/penguin.cpp
index ccd9f05eb4cbdc2e2fdefcda5620e0c8e1b66aa6..dde9a8791eee90db08dced98f77572f8cf05ddd4 100644
--- a/src/game/penguin.cpp
+++ b/src/game/penguin.cpp
@@ -91,8 +91,7 @@ namespace game
 	/* Number of moves that you can play */
 	uint16_t penguin::number_of_moves() const
 	{
-		//return 9 - state.total_moves;
-		return 0;
+		return state.current_player_red ? state.nb_moves_red : state.nb_moves_blue;
 	}
 
 	/* The penguin that will move if we want to play the #move_number move in the list of possible moves.
@@ -178,48 +177,48 @@ namespace game
 		uint8_t move_number = ((*p) >> 6) & 63; //Move number for the current penguin
 		uint32_t penguin_copy = (*p) >> 12;
 		//Direction A
-		if((penguin_copy & 7) >= move_number)
+		if((penguin_copy & 7) > move_number)
 		{
 			//Move direction A
-			(*p) = (7 * move_number +1) + ((*p) & 63);
+			(*p) = (7 * (move_number +1)) + ((*p) & 63);
 			return;
 		}
 		move_number -= penguin_copy & 7;
 		penguin_copy = penguin_copy >> 3;
-		if((penguin_copy & 7) >= move_number)
+		if((penguin_copy & 7) > move_number)
 		{
 			//Move direction B
-			(*p) = (-1 * move_number +1) + ((*p) & 63);
+			(*p) = (-1 * (move_number +1)) + ((*p) & 63);
 			return;
 		}
 		move_number -= penguin_copy & 7;
 		penguin_copy = penguin_copy >> 3;
-		if((penguin_copy & 7) >= move_number)
+		if((penguin_copy & 7) > move_number)
 		{
 			//Move direction C
-			(*p) = (-8 * move_number +1) + ((*p) & 63);
+			(*p) = (-8 * (move_number +1)) + ((*p) & 63);
 			return;
 		}
 		move_number -= penguin_copy & 7;
 		penguin_copy = penguin_copy >> 3;
-		if((penguin_copy & 7) >= move_number)
+		if((penguin_copy & 7) > move_number)
 		{
 			//Move direction D
-			(*p) = (-7 * move_number +1) + ((*p) & 63);
+			(*p) = (-7 * (move_number +1)) + ((*p) & 63);
 			return;
 		}
 		move_number -= penguin_copy & 7;
 		penguin_copy = penguin_copy >> 3;
-		if((penguin_copy & 7) >= move_number)
+		if((penguin_copy & 7) > move_number)
 		{
 			//Move direction E
-			(*p) = (1 * move_number +1) + ((*p) & 63);
+			(*p) = (1 * (move_number +1)) + ((*p) & 63);
 			return;
 		}
 		move_number -= penguin_copy & 7;
 		penguin_copy = penguin_copy >> 3;
 		//Move direction F
-		(*p) = (8 * move_number +1) + ((*p) & 63);
+		(*p) = (8 * (move_number +1)) + ((*p) & 63);
 	}
 
 	int penguin::update_moves(uint32_t* p, uint64_t obstacles)
diff --git a/tools/drawState.py b/tools/drawState.py
index ee01d4a116ae2092bd96290c34c1cf191a44d8e2..8479eb109e9903428735f137339d721317996eb8 100755
--- a/tools/drawState.py
+++ b/tools/drawState.py
@@ -30,9 +30,10 @@ def drawPenguin(penguin):
 		"D" : str((penguin >> 21) & 7), 
 		"E" : str((penguin >> 24) & 7), 
 		"F" : str((penguin >> 27) & 7), 
-		"tot" : str((penguin >> 6) & 63).rjust(2)
+		"tot" : str((penguin >> 6) & 63).rjust(2),
+		"tot-1": str(max(((penguin >> 6) & 63)-1, 0)).rjust(2)
 	}
-	print("Pos: {pos}, A:{A}, B:{B}, C:{C}, D:{D}, E:{E}, F:{F}, Tot: {tot}".format(**args))
+	print("Pos: {pos}, A:{A}, B:{B}, C:{C}, D:{D}, E:{E}, F:{F}, Tot: {tot} [0..{tot-1}]".format(**args))
 
 if __name__ == "__main__":
 	try:
diff --git a/tools/gui.py b/tools/gui.py
index 3d50e59393ec9bbff1550a9b744505038e177d95..9066a562e1f0ac0c7b62cc20a411ff2a56679d93 100755
--- a/tools/gui.py
+++ b/tools/gui.py
@@ -32,10 +32,10 @@ if __name__ == "__main__":
 			print("Comments: {}".format(''.join(comments)))
 			state = json.loads(''.join(json_data))
 			drawState.drawBitboard(state["bitboards"]["onefish"],state["bitboards"]["twofish"],state["bitboards"]["threefish"])
-			print("Red penguins (Red score: {}, Total moves: {})".format(state["score"]["red"], state["nb_moves"]["red"]))
+			print("Red penguins (Red score: {}, Total moves: {} [0..{}])".format(state["score"]["red"], state["nb_moves"]["red"], state["nb_moves"]["red"]-1))
 			for i in range(4):
 				drawState.drawPenguin(state["penguins"]["red"][i])
-			print("Blue penguins (Blue score: {}, Total moves: {})".format(state["score"]["blue"], state["nb_moves"]["blue"]))
+			print("Blue penguins (Blue score: {}, Total moves: {} [0..{}])".format(state["score"]["blue"], state["nb_moves"]["blue"], state["nb_moves"]["blue"] -1))
 			for i in range(4):
 				drawState.drawPenguin(state["penguins"]["blue"][i])
 			#PLAY NEXT MOVE