added writing tests