started working on the emulator
more work on code