add an example for optimizing