added write method
Merge pull request #51 from Tobscher/master

added write method to index