started work on the C version of the emulator