add potential function