added termination to emulator, added comment