isolated the 'number to words' functionality into a separate function