accept_input = io.read split_string = (s) -> [x for x in string.gmatch(s,"(%S+)")] capitalize_word = (word) -> string.gsub(word,"^(.)",string.upper) uppercase_words = (array) -> [capitalize_word(word) for word in *array] print_words = (array) -> for word in *array do print(word) sort_words = table.sort apply_caps = (str) -> words = split_string(str) words = uppercase_words(words) sort_words(words) words --return the apply_caps() function when we require() apply_caps