finding scale factor