added state machines for mega and mimic