***help:  how to read analog output from lm34

I had all kinds of problems with my LM34DZ. I was getting odd values. I think it was a bit of a loose wire though, because now it is working perfectly. I was able to bring the temperature down by placing an ice cube in a shot glass next to the LM34DZ.

LM34DZ TO-92

+5 to +Vs
GND to GND
Analog 0 to Vout

Here's my code:

int analogInput = 0;
int tempF = 0;

void setup(){
beginSerial(9600);
}

void loop(){

tempF = (500.0 * analogRead(analogInput)) / 1024;
Serial.print("Temperature: ");
Serial.println(tempF, DEC);
delay(100);
}