implement transform function