what is the role of lungs in circulation