improved logic, added comments to wordfnder