Added data/metadata writing