now it distributes the tasks properly among all threads, and it can be used as a standalone program. there are some minor performance issues which will be fixed shortly.