wordpair logic added