updated method of finding words