Changed buttons to toggle buttons, and refactored.
Changed buttons to toggle buttons, and refactored.