[Add CSV code and imporved the code]