rest state diagram