added the export function