added tracing class, cleaned up a little