Pattern tracing