nasty nasty bug - removed duplicates while creating chains