How does a lung transplant work?

Really my question is when they remove a bad lung to put in a good one, wouldn't they be disconnecting all the alveoli from the capillaries, or maybe not, maybe I have the wrong picture here, basically what blood vessels are the alveoli connected to that distributes the oxygen to the body from the lungs, and how do they reconnected the GOOD lung with the circulatory system, a picture would be helpful of how the systems are connected.

2017-04-11T00:37:33.809Z