to switch or not to switch function