By products of power thermal plant operation need to be considered in both the design and operation. Waste heat due to the finite efficiency of the power cycle must be released to the atmosphere, using a cooling tower, or river or lake water as a cooling medium. The flue gas from combustion of the fossil fuels is discharged to the air; this contains carbon dioxide and water vapour, as well as other substances such as nitrogen, nitrogen oxides, sulphur oxides, and (in the case of coal-fired plants) fly ash, mercury and traces of other metals.