Changed to Mux

Additionally, cleaned up a lot of code.