Change attack function to defend