added debug code to print out state of CPU