Added using min / max to temp rather than the average of the two.