Code now makes full use of trace library