Finished assign_defenses method