carbon dioxide from the air is used to produce glucose and other  compounds.
Blood Filtration in the Kidney. The kidneys filter about one-quarter (750-1000 pints) of the blood that is output by the heart daily. This blood is sent to the body's filter treatment plant, where it is purified by the kidneys and circulated on to the rest of the body. Some of the blood flow becomes fluid waste (1/1000th to 2/1000th) and is sent into the bladder for storage until it can be conveniently expelled. This toxic waste is called urine.
Essentially, the blood is filtered through the kidney where wastes and water, minerals, salts, sugars, etc are removed. Some of the sugars and such are reabsorbed back into your blood. Whatâs left in the kidney after filtration of the blood; the toxins, salts, urea, ammonia, excess water, etc becomes urine.