Here's the code (written a bit differently) but with the debugging statements.
Where?
What are you reading from the mux shield? Unless you KNOW that, you are just guessing that the rest of the code is doing what you want. I gave up on guessing what code does my second week as a coder. I strongly suggest that you do, too.