Cleaned up the power transform code