Function ammended.