Added RedoDimsCode to compute size of work(z)