Added rule for EXIT,  added index for B