FIXED THE LOOPING AROUND THE BEGINING