Tested and fixed the remove duplicates function for the PL shape.