added docs, worked on removing write_error