update the export function to actually work!