Moved padding alg. into width loop

Probably should have done that first.