standardize variable names
Add znorder function for multiplicative order