wrote capitalize function which ensures the input string is all-caps