graphical ui friendly processing logic added (progressbar is bugged)