add bad & good algorithm, add task for pair method