writing output