A gem for validating chemical formula and calculating analysis