Now remove duplicates around first w
with test for multiple w with dup codes around it