Added degeneracy statistics extraction;
fixed bug with sorting of structures.