some work on the export function