Some fix

Move calculation to inside the if statement, and fix the check to
include only our rooks