Understanding the preferential adsorption of CO2 over N2 in a flexible metal-organic framework.