Added causality checking in the system. Still causality is not perfect, need to take care of if (S1) else emit S1 pause