add test
fix a bug of a part of calculating the different element numbers