Fix offset issue
Add sub gradient method
Fix step size for sub gradient method
Add stop criteria for sub gradient method and gradient descent
Update UI
Move calculation to background thread