fixed bugs in mux's inputs were flipped