for final analysis : now prints the results in csv file, still problem for grouping different conditions