Added check for convergence to 0
Removed set scale from inside the loop to outside to avoid cascading scale problems