Propagating the comparison fucntion during the recursion