second version of the potential calculation