Hackaround for imports
Fixed averaging transform to match Gale's code