How to make better cookies with science