Changed the way internal state is represented in each state of the IMCs.