changed to separate out inputs before input to mux.