add write method
Merge pull request #6 from juliendangers/master

add write method