Revert "Revert "toggle function.""

This reverts commit f1b873dd830d59f2f42fcdbad59e23267ec00527.