Added write tests