functional async export. still needs some stylin.
replace tabs with spaces to be consistent