Added code for pH adjustment