add function to judge