Working without duplicates now. Tidying up to follow