a more idomatic way of adding cookies