Working LEDs Appear Dim in Temperature Sensor Project (Love Meter)

Hello, this is my first time posting. Been coding lightly for a week now, and decided to do the temperature sensor project from the official Arduino starter bundle.

Here is my code:

const int sensorPin = A0;
const float baselineTemp = 20.0;
void setup() {
  Serial.begin(9600);
  for(int pinNumber = 2; pinNumber<5; pinNumber++){
    pinMode(pinNumber,OUTPUT);
    digitalWrite(pinNumber,LOW);
  }
}
void loop(){
  int sensorVal = analogRead(sensorPin);
  Serial.print("Sensor Value =  ");
  Serial.print(sensorVal);
  float voltage = (sensorVal/1024.0) * 5.0;
  Serial.print(", Volts: ");
  Serial.print(voltage);
  Serial.print(", degrees C: ");
  float temperature = (voltage - 0.5) * 100;
  Serial.println(temperature);
  if(temperature < baselineTemp){
    pinMode(2,LOW);
    pinMode(3,LOW);
    pinMode(4,LOW);
  }else if(temperature >= baselineTemp+2 && temperature < baselineTemp+4){
    digitalWrite(2,HIGH);
    digitalWrite(3,LOW);
    digitalWrite(4,LOW);
  }else if(temperature >= baselineTemp+4 && temperature < baselineTemp+6){
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,LOW);
   }else if(temperature >= baselineTemp+6){
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,HIGH);
   }
   delay(1000);
}

I tested the LEDs to make sure there weren't any errors with the pins themselves by coding a quick output script from the same pins used during this project and found the pins still work, supplying the necessary output for a good, bright LED.

Any help would be appreciated!

What is the name of that sketch ?

The title of the Chapter in the book (Chapter 3) is called Love-o-meter.

I saved the sketch as TemperatureSensor in my computer.

That's what I thought. This question has come up before and I posted the fix but I have to find it.

FYI, I just browsed around and found that the code exists in the IDE. I uploaded that code and the LEDs shine nice and bright! If you find that answer, it would be much appreciated.

I'll continue looking too, of course.

EDIT: I just noticed that I used a pinMode function instead of a digitalWrite for the beginning of the if statement after the Serial.print commands. I guess this makes a difference? Sorry to waste your time!

EDIT2:

New code for anyone else viewing this and they want to snag it later.

const int sensorPin = A0;
const float baselineTemp = 20.0;
void setup() {
  Serial.begin(9600);
  for(int pinNumber = 2; pinNumber<5; pinNumber++){
    pinMode(pinNumber,OUTPUT);
    digitalWrite(pinNumber,LOW);
  }
}
void loop(){
  int sensorVal = analogRead(sensorPin);
  Serial.print("Sensor Value =  ");
  Serial.print(sensorVal);
  float voltage = (sensorVal/1024.0) * 5.0;
  Serial.print(", Volts: ");
  Serial.print(voltage);
  Serial.print(", degrees C: ");
  float temperature = (voltage - 0.5) * 100;
  Serial.println(temperature);
  if(temperature < baselineTemp){
    digitalWrite(2,LOW);
    digitalWrite(3,LOW);
    digitalWrite(4,LOW);
  }else if(temperature >= baselineTemp+2 && temperature < baselineTemp+4){
    digitalWrite(2,HIGH);
    digitalWrite(3,LOW);
    digitalWrite(4,LOW);
  }else if(temperature >= baselineTemp+4 && temperature < baselineTemp+6){
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,LOW);
   }else if(temperature >= baselineTemp+6){
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,HIGH);
   }
   delay(1);
}

Try this example:
http://www.mrbenson.org/arduino-love-o-meter/
or this one