Added most of the logic needed by the processor.