Refactored dashBorder function.