Cleanup.
Added writing.