Cleaned up button code and added on/off toggling.