Optimization of lung function during ex-vivo lung perfusion