added if to remove blank space in words.