Work on states
Complete example