Qthread

Replaced multiprocessing module with qthreads
A window implies resegmentation and for that a different algorithm is used. I'll try to make it more explicit.