Added code to print results to csv.