Completed the task

The task is made but the threads are not being deleted, thus giving
place to memory leak.
Update to perfomance