refactored hundredsWords function in scripts.js