implement firs power switch algo