Refactored code (mostly surrounding army placement).