implemented function "isMatePosition". Hopefully it is right.