resolve bugs in judge(start to deal with efficiency)