use switch instead of mux, more obvious what is happening