how do the heart and lungs work together