Changed the tranformation function in the metric.

* Also renamed a few internal variables for clarity.