put in the checking on duplicate answers code
update based on suggestion from J Rezeau