implement search by pattern only with first expression
imrpove generating tree