add z rescaling also