writing dict