Added the auto_detect_sample_row function