script for exporting data