fixed bug in the duplicate polygon removal algorithm, now includes the original and doesnt change the order