Adding tracing to choose functions