testing attack function