remove duplicate rows after reducing linear combinations