Fixed potential function and a made sure functions are being sent correctly.