Added toggling of modes