Open the hatch fully and disconnect the negative battery cable at the battery. Remove the forward portion of the rear window trim, then pull the weather stripping off the rear end of the roof and lower the headliner slightly to access the hatch hinges. Disconnect the electrical connector for the rear defroster from the rear pillar. While an assistant supports the rear end of the hatch, disconnect the damper stay nut where the damper meets the side pillar. Carefully close the rear glass hatch and move to the inside of the car to scribe around the hinge attaching nuts with a pen or metal scribe to locate the glass in its original position. Remove the hinge attaching nuts, release the hatch lock, and with assistance, lift the hatch, dampers, and hinges off the car as a unit. If necessary, remove the damper stays, hinges, and hatch lock from the glass hatch. If replacing the damper stays, ensure the old units are not punctured or placed in an open fire due to their high-pressure gas and oil content; dispose of them properly at a Mazda dealer or local fire department. Before installing the hatch, install any components removed from the glass, then place the hatch into position and loosely install the hinge nuts without tightening. Align the hinge attaching nuts with the marks made during disassembly and tighten until snug, then lower the hatch to check for proper alignment at the sides and where the hatch striker meets the hatch lock at the rear. Adjust the glass hatch as necessary for proper alignment and securely tighten the hinge nuts. Connect the damper stays to their mountings on the rear pillar and reconnect the electrical connectors for the defroster. Wrap the material headliner around the metal lip of the hatch until tight, then press the weather stripping over the material and metal lip, taking time to smooth out any wrinkles. Install the rear window trim piece, connect the negative battery cable, and check for proper operation of the defroster.