fixed word_to_number library function