Switch function has little constraint in sampling