Improve the code to allow heterogeneous species.
Improve the code to allow heterogeneous species.