writes out