OPTIMIZATION OF THE GAS FLOW IN A GEM CHAMBER AND DEVELOPMENT OF THE GEM FOIL STRETCHER