Add events to the rosenbrock example