revised library instrumentation code