changed speed of sound calculation