corrected to work for more than one word