Reversible isothermal expansion of the gas at the "hot" temperature, T1 (isothermal heat addition or absorption). During this step (1 to 2 on Figure 1, A to B in Figure 2) the gas is allowed to expand and it does work on the surroundings. The temperature of the gas does not change during the process, and thus the expansion is isothermal. The gas expansion is propelled by absorption of heat energy Q1 and of entropy Delta S=Q_1/T_1 from the high temperature reservoir.
Isentropic (reversible adiabatic) expansion of the gas (isentropic work output). For this step (2 to 3 on Figure 1, B to C in Figure 2) the mechanisms of the engine are assumed to be thermally insulated, thus they neither gain nor lose heat. The gas continues to expand, doing work on the surroundings, and losing an equivalent amount of internal energy. The gas expansion causes it to cool to the "cold" temperature, T2. The entropy remains unchanged.
Reversible isothermal compression of the gas at the "cold" temperature, T2. (isothermal heat rejection) (3 to 4 on Figure 1, C to D on Figure 2) Now the surroundings do work on the gas, causing an amount of heat energy Q2 and of entropy Delta S=Q_2/T_2 to flow out of the gas to the low temperature reservoir. (This is the same amount of entropy absorbed in step 1, as can be seen from the Clausius inequality.)
Isentropic compression of the gas (isentropic work input). (4 to 1 on Figure 1, D to A on Figure 2) Once again the mechanisms of the engine are assumed to be thermally insulated. During this step, the surroundings do work on the gas, increasing its internal energy and compressing it, causing the temperature to rise to T1. The entropy remains unchanged. At this point the gas is in the same state as at the start of step 1.