Added optional iteration-averaging of potential.