Temperature code adjusted to work with Huw's data structure