implemented O(n) consecutive capitalization check