how do your heart and lungs work together