Corrected word search script