adding internal energy fn