Working function of transformer