A buffer keeps a solution's pH constant by