Implement Switching Logic

Added time-varying switching logic