Fixed removeduplicates to take negative correlation into account
Improvements