remove duplicates and order properly
getting rid of merge errors