anchor.diff:      ExprSize = no_of_nodes(Expr1),
       case Res of 
   	{true, Subst} -> 
  -	    Score = 1 -(no_of_nodes(Subst)/ExprSize),
  +	    {SubExprs1, _SubExprs2} = lists:unzip(Subst),
  +	    Score = 1 -((no_of_nodes(SubExprs1)-length(SubExprs1))/ExprSize),
   	    case Score>=?SimiScore of 
   		true ->
  -		    [{get_start_end_loc(Expr2), no_of_nodes(Subst), Subst}];
  +		    {{S1,E1}, {S2, E2}} = get_start_end_loc(Expr2),
  +		    Expr2FreeVars = refac_util:get_free_vars(Expr2),
  +		    SubstWithFreeVars = lists:map(fun({SubExpr1, SubExpr2}) -> {SubExpr1, {SubExpr2, Expr2FreeVars}} end, Subst),
  +		    [{{S1, E1, S2, E2}, SubstWithFreeVars, Expr2}];
   		_ -> []
   	    end;
   	_ -> []
  
positive.code: 		 end;
  	     _ -> case refac_syntax:type(Exp) of 
  		      match_expr -> false;
  		      _ -> true   %% Any others?
  		  end
  	 end,
      _Exp_Free_Vars = refac_util:get_free_vars(Exp),
      Exp_Export_Vars =refac_util:get_var_exports(Exp),
      Res1 andalso (Exp_Export_Vars ==[]).
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  generalise_expr(Exprs, SearchRes) when is_list(Exprs)->
      generalise_expr(refac_syntax:block_expr(Exprs), SearchRes);
      
  generalise_expr(Expr, SearchRes) ->
      SubExprs = lists:usort(lists:flatmap(fun({_,_, Es}) ->
  						 lists:map(fun(E) ->refac_util:get_range(E) end, Es)
  					 end, SearchRes)),
      case SubExprs of 
  	[] -> Expr;
  	_ ->
  	    NewVars = lists:map(fun(N) -> "NewVar"++integer_to_list(N) end, lists:seq(1, length(SubExprs))),
  	    Pairs = lists:zip(SubExprs, NewVars),
  	    {Expr1, _}= refac_util:stop_tdTP(fun do_replace_expr_with_var/2, Expr, Pairs),
  	    Expr1
      end.
      
   
  do_replace_expr_with_var(Tree, RangeVarNamePairs) ->
      Range = refac_util:get_range(Tree),
      case lists:keysearch(Range, 1, RangeVarNamePairs) of 
  	{value, {Range, VarName}}  ->
  	     {refac_syntax:variable(VarName), true};
  	_ -> {Tree, false}
      end.
  		  
  
  
  format_exprs(Exprs) when is_list(Exprs) andalso (length(Exprs) >1) ->
      refac_prettypr:format(refac_syntax:block_expr(Exprs));
  format_exprs(Exprs) when is_list(Exprs) ->
  
negative.code: 	[] -> throw({error, "You have not selected an expression!"});
  	_ -> ok
      end,
      RecordInfo =get_module_record_info(FName, SearchPaths, TabWidth),
      Exprs1 = case length(Exprs) of 1 -> hd(Exprs); _ -> Exprs end,
      ?wrangler_io("The selected expression after normalisation is:\n\n~s\n\n",
  		 [format_exprs(normalise_expr(Exprs1, RecordInfo))]),
      Res =do_search_similar_expr(AnnAST, RecordInfo, Exprs1),
      Res1 = lists:map(fun({Range, _, _})-> Range end, Res),
      {{S, E}, {S1,E1}} = get_start_end_loc(Exprs),
      Res2 = lists:usort([{S, E, S1, E1} | Res1]),
      AntiUnifier = generalise_expr(normalise_expr(Exprs1,RecordInfo),Res),
      case length(Res2) of  
  	0 -> ?wrangler_io("No similar expression has been found.\n",[]);  %% This should not happen.
  	1 -> ?wrangler_io("No similar expression has been found.\n", []);
  	N -> ?wrangler_io("~p expressions (including the expression selected) which are similar to the expression selected have been found. \n", [N]),
  	     ?wrangler_io("The generalised expression would be:\n\n~s\n\n", [format_exprs(AntiUnifier)]),
  	     {ok, Res2}
      end.
  
  do_search_similar_expr(AnnAST, RecordInfo, Exprs) when is_list(Exprs) ->
  