corrected infinite loop in cpu.c