Added functionality to check for dups. Also pulled out functionality into seperate method for checking if something is done.