Milk of magnesia, which is magnesium hydroxide, is used to cure stomach acidity. What is the mode of action of this drug?