Extracted border population to a method. Simplified border population.