cleaner code for attacking