Added print to csv function