Added base for toggling algorithm