Refactored to more functional style. Added "all" regions, brackets.