X-ray diffraction coupled thermogravimetric investigations of YBa2Cu3O7−x