Delete unnecessary codes

The commented codes should be deleted, and the signature of this function is also modified