Fixed the variable name confusion between temp temporary and temperature