Changed some calculations related to median temp