Toggle between states

For #23.

I wasn't sure about commiting the example but I guess it works as a test :P