write some of emulator