Change from dist to squared dist and change divide from T to sqrt(T) in rpm step