refactored to make number_to_words more readable