Optimize probability calculation; do some check on the input task
Modify the check on the task