flatten datasets