Added sameword code.