apply.scaling function

Apply scaling factors