Start of transformation function