changed prototypes as each function has to have the same signature
added fflush functions
added print opcodes
cleanup in stuff