added find word funct and fixed some bugs