Improves performance of CO2 function

Also adds groundwork for performance testing