Write out state