The function of the stomata in a leaf is