add sort function for 2 arrays