Started working on an internal state for emulator.