Fixed the multiplexer. The conditions on when Y = A and then Y = B were the wrong way around.