Fixed capitalize implementation
The implementation now capitalizes the first letter of every new word
rather than just capitalizing the first letter of the string.