adding CSV export function