advancing in word search, but ugly code