Created twice_tied function to check if there is a doubly tied word array