write sameexponent Product func