Updated mux code