Added working toggle functionality