add sort function for multiple array