Added a toggle() function