added logging to csv