second attempt with isset to check repeated words