Prerobeny stavovy diagram.