added hpsTransformation function