Added a shift register function.