fixed state diagrams, added explanation