updated the code to add a while do loop for attacking the guards.