Add method sort for array in afm object

Add method sort for array in afm object