added writeDatapackage