initial emulator code