wrote a function to calculate mean square deviation over many values of temperature