implemented map function in updateLight and updateTemperature functions