revised to not print doubles