iterative shifting