This high-temperature high-pressure gas enters a turbine, where it expands down to the exhaust pressure, producing a shaft work output in the process. The turbine shaft work is used to drive the compressor; the energy that is not used for compressing the working fluid comes out in the exhaust gases that can be used to do external work, such as directly producing thrust in a turbojet engine, or rotating a second, independent turbine (known as a power turbine) which can be connected to a fan, propeller, or electrical generator. The purpose of the gas turbine determines the design so that the most desirable split of energy between the thrust and the shaft work is achieved.