slight logic change which seems to work on generating mux selector