added test for writing orders