refactor, add explicit check for oxidation states