 
         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
             }

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

        playerTurn.invert()
    }

    /// Executes a move without checking the legality of the move.
    private func _execute(move move: Move) throws {
        try _execute(move: move, promotion: { .Queen(playerTurn) })
    }

    /// Executes `move`, updating the state for `self`.
    ///
    /// - Parameter move: The move to be executed.
    /// - Parameter promotion: A closure returning a promotion piece if a pawn promotion occurs.
    ///
    /// - Throws: `MoveExecutionError` if `move` is illegal or if `promotion` is invalid.
    public func execute(move move: Move, @noescape  promotion: () -> Piece) throws {
        guard isLegal(move: move) else {
            throw MoveExecutionError.IllegalMove(move, playerTurn, board)
        }
