moved box_scaling_factor to function argument