updated state diagram