design switch basic logic