Rational design of functionalized covalent organic frameworks and their performance towards CO2 capture