code cleanup supporting math type choice, adding multiply topic