hotOrCold function written