Removed redundant calc_pH code.