added cleanup and csv import function