calculate scales