added shift register code from mp2, updated for 16 bits