try to implement a bag of tasks