added write tests