We are now going to implement a good queue and use it.
Final version. Threading issues solved.