Implement basic path tracing.