added scale factor for distance