found one bug, which allowed scaling = 0