Learning to fry glazed donuts