problem controlling 16 leds with shift register and LDR

int lightpin=0;
int latchpin=5;
int clockpin=6;
int datapin=4;
int leds=0;
void setup()
{
  pinMode(latchpin,OUTPUT);
  pinMode(datapin,OUTPUT);
  pinMode(clockpin,OUTPUT);
}
void loop()
{
  int reading = analogRead(lightpin);
  int numLEDSLit=reading/57;
  if (numLEDSLit>8) 
  numLEDSLit=8;
  leds=0;
  
  for (int i=0;i<numLEDSLit;i++)
  {
    leds=leds+(1<<i);
  }
  updateShiftRegister();
}
void updateShiftRegister()
{
  digitalWrite(latchpin,HIGH);
  shiftOut(datapin,clockpin,MSBFIRST,leds);
  digitalWrite(latchpin,LOW);
}

So what is it doing that you don't want it to do, and what is it not doing that you do want it to do ?
how many leds are you trying to control ?

if (numLEDSLit>8) 
  numLEDSLit=8;