Serial.read(); is saving in the intager i use to diffine the lenght of char i want to store in

Exactly. Because you have not defined the storage for array z[ ] correctly, anything you put in z[ ] will start overwriting other variables like, for instance, variable e.

Try this. As far as I can see, you actually need only 6 bytes to hold those 5 binary digits.
char z[ 10 ] = { 0 } ;