Added code to control a shift register