Moved declaration of float temperature out of the loop