Updated the functionality to allow a button to toggle.

Removed the test function. Added code to all for a button to toggle.