added state diagrams