refractored the code for the excel export yet to test