updated temp logic