Updated state diagram and basic function desc