refactored one of the horrible transforms.

only about 10000 left.