use conditional assignment