fixed mat and compound numbering issiue