Nitrogen doping and CO2 adsorption on graphene: A thermodynamical study