I considered this question, the function should be simple, and only one function: to determine whether target is legal. so i put this fix out of the function.    I will try to fix it via `pybind` later. how about\uff1f