Added potentials update function.