optimizing cooking time