add gainExp function