Updated write test