removed shifts from loops