modified stage 1 so that s4 fold to s0 as they are the same state