 
         let player = playerTurn
         for moveSquare in movesBitboard.squares {
-            try! _execute(move: square >>> moveSquare, promotion: nil)
+            try! _execute(move: square >>> moveSquare)
             if board.attackersToKing(for: player) != 0 {
                 movesBitboard[moveSquare] = false
             }

    }

    /// Executes a move without checking the legality of the move.
    private func _execute(move move: Move, promotion: (() -> Piece)?) throws {
        let piece = board[move.start]!
        var endPiece = piece
        var capture = board[move.end]
        var captureSquare = move.end
        if case .Pawn = piece {
            if move.end.rank == Rank(endFor: playerTurn) {
                let promotion = promotion?()
                if let p = promotion {
                    guard p.color == playerTurn else {
                        throw MoveExecutionError.InvalidPromotionPiece(p)
                    }
                }
                endPiece = promotion ?? .Queen(playerTurn)
            } else if move.end == enPassantTarget {
                capture = Piece.Pawn(playerTurn.inverse())
                captureSquare = Square(file: move.end.file, rank: move.start.rank)

        guard let (move, promotion, attackers) = _undoHistory.popLast() else {
            return nil
        }
        if let promotion = promotion {
            try! _execute(move: move, promotion: { promotion })
        } else {
            try! _execute(move: move)
        }
        attackersToKing = attackers
        return move
    }
