Adding toggle feature

this commit includes toggle functionality in the the file