Master 4051 with 8 4051 Slaves

I am using one 4051 as a master with 8 4051 slaves, I found some code on the internet and I am trying to modify it but I am a new be at programming. when I’m putting 5v on the inputs I get all these random voltage reading?

My results

Input 0: 24 v
Input 1: 63 v
Input 2: 6 v
Input 3: 82 v


Input 63: 48 v

//I have multiple wires (64 of these) which values I want to read voltage.
//I am using a master multiplexer HC4051 connected to 8 slave multiplexers
// 74XX4051 ADDRESS PINS :
int M_S0 = 2;
int M_S1 = 3;
int M_S2 = 4;

int S_S0 = 7;
int S_S1 = 6;
int S_S2 = 5;
int Z = A0;
int MUX64[64] = {0};

void setup() {
      // CONFIGURE ADDRESS PINS
    pinMode(M_S0, OUTPUT);
    pinMode(M_S1, OUTPUT);
    pinMode(M_S2, OUTPUT);
    pinMode(S_S0, OUTPUT);
    pinMode(S_S1, OUTPUT);
    pinMode(S_S2, OUTPUT);
  Serial.begin(9600);   
  
}

void loop() {
   // LOOP THROUGH ALL THE ADDRESSES OF THE MASTER 
    for (int i = 0; i < 64; i++) {
        
    digitalWrite(M_S2, HIGH && (i & 0b1000000));
    digitalWrite(M_S1, HIGH && (i & 0b100000));
    digitalWrite(M_S0, HIGH && (i & 0b010000));        
    digitalWrite(S_S2, HIGH && (i & 0b000100));
    digitalWrite(S_S1, HIGH && (i & 0b000010));
    digitalWrite(S_S0, HIGH && (i & 0b000001));
    delay(1);
    MUX64[i] = analogRead(Z);    
    
    
     

    Serial.print("Input ");
    Serial.print(i);
    Serial.print(": ");
    Serial.print(MUX64[i]);
    Serial.println(" v ");
    delay(1000); 
}

}