Syntax error fix, the start of the isAttacked function