Export function nearly finished; only download link missing now