more generic export; not fully working yet