Created function for transform calculation