Progressbar, codedesign and cancelbutton

Implmented cancelbutton and progressbar, moved a lot of code