improved code for test_emulator