Finish transform function