added basic :write functionality -- doesn't append to the end of file yet