Identifying syntactically or functionally similar code fragments in source code is an importantresearch question in software engineering. Many researchers pointed out that detecting and refactoring code clones can be beneficial for software maintenance purposes.This work presents a clone detector algorithm. The proposed approach uses a source code AST representation and identifies similar fragments by generating and filtering pattern trees created from subtree pairs. The algorithm extends the existing technique of tree comparison by including Munkers assignment algorithm (The Hungarian method) and the longest common subsequence algorithm. Munkres assignment algorithm helps to identify rearranged code fragments. The LCS algorithm is used to compare subtrees of different syntactic variants. Experiments showed that these algorithms can help better evaluate code fragments to identify duplicates.