Add toggle functionality

this commit includes toggle functionality in the the file