implemented csv to excel function, refactoring