adding state switching to the buttons #17

for some reason it isn't working yet.