use double precision for scale and most places for higher accuracy.