[Think]
    modify one for loop to double for loop
[Russell]
    add feature, support input check