improved construction of tfSearch matrix.