Simplified the logic for looping through cpus and executing instructions.