swapped to fast scaling algorithm