updated function for the temp