improved analyze_csv