I tried as you suggested. When i put the Serial.Println commands the code started working. Then i realized that maybe i my code and the shift register were simply no in sync and that i needed to put a few delays to keep them in sync. The code works now . Thanks for all the help.