fixed shift code for multiscale