Added some instrumentation code