Multiple while loops

Now it runs through until the scale factors don't change, then runs
through one more time for good measure.