utilize recursion to optimize the algorith, bug fix

bug report:
if(ss1>>nword1&&ss2>>nword2)
condition fails b/c ss2,     ss1 still fetch the word!!