Thread lock
same as last commit
add progress bar and fix up calibration bug