Updated emulator logic