Problem shifting bitwise Output

I repeat: what values are you passing in and what patterns are going to the relays? Without both there is no information for us to go on.