Determination of pH; theory and practice